package com.jdbc.utils;

/**
 * @author wzm
 * @create 2023-02-23 16:15
 */
public class BaseDaoTest {
    public static void main(String[] args) {

        BaseDao baseDao = new BaseDao();


        //新增
       // String sql = "insert into student values(?,?,?,?,?,?)";

       //删除
       // String sql = "delete from student where id = ?";
//        String sql = "update student set stu_name = ?,stu_sex = ?,age = ?, address = ?,status = ? where id = ? ";
//
//
//        int update = baseDao.update(sql, "刘德华", "男", 85, "香港", 1, 5);
//        System.out.println("update = " + update);
        
        
        //查询单个对象
//        String sql = "select id,stu_name stuName,stu_sex stuSex,age,address,status from student where id = ?";
//        Student student = baseDao.selectForOne(Student.class, sql, 5);
//        System.out.println("student = " + student);
        
//        String sql ="select id,stu_name stuName,stu_sex stuSex,age,address,status from student";
//        List<Student> list = baseDao.selectForList(Student.class, sql);
//        System.out.println("list = " + list);
        
        
        String sql = "select avg(age) from student where id > ?";
        Object o = baseDao.selectForValue(sql,2);
        System.out.println("o = " + o);
    }
}
